﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PassportManage
{
    public partial class Form_Loading : Form
    {
        public Form_Loading()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.None;
            this.labload.Width = 0;
            CenterToScreen();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            this.labload.Width += 3;
            if (labload.Width >= label1.Width)
            {
                this.timer1.Enabled = false;
                Form_Login f = new Form_Login(this);
                f.ShowInTaskbar = false;
                f.Show();
                this.Visible = false;


            }
//             if (labload.Width > label1.Width / 2 && labload.Width < label1.Width / 3 * 2)
//             {
//                 OleDbConnection conn = null;
//                 try
//                 {
//                     conn = Dbhelper.GetOleDbConnection();
//                     conn.Open();
//                 }
//                 catch
//                 {
//                     this.timer1.Enabled = false;
//                     MessageBox.Show("数据加载失败....");
//                     this.Close();
//                 }
//                 finally
//                 {
//                     conn.Close();
//                 }
//             }
        }

        private void Form_Loading_FormClosed(object sender, FormClosedEventArgs e)
        {
            MessageBox.Show("护照存取管理系统已经正常退出，感谢您的使用，祝您工作顺利！！");
        }
    }
}
